//
//  NSString+MKUITheme.m
//  MKUI
//
//  Created by 苏尚进 on 2021/3/20.
//  Copyright © 2021 moon. All rights reserved.
//

#import "NSString+MKUITheme.h"
#import "MKUIThemeCenterElement.h"

@implementation NSString (MKUITheme_Selector)

- (NSString *)mktheme_uppercaseFirstLetterString{
    NSString *name = nil;
    if(self.length==1){
        name = self.uppercaseString;
    }else if(self.length>1){
        name = [NSString stringWithFormat:@"%@%@",[self substringToIndex:1].uppercaseString,[self substringFromIndex:1]];
    }else{
        name = self;
    }
    return name;
}
+ (SEL)mktheme_setSelectorForProperty:(NSString *)propertyName{
    NSString *selectorName = nil;
    selectorName = [NSString stringWithFormat:@"set%@:",propertyName.mktheme_uppercaseFirstLetterString];
    return NSSelectorFromString(selectorName);
}
+ (SEL)mktheme_setSelectorForStatedProperty:(NSString *)propertyName{
    NSString *selectorName = nil;
    selectorName = [NSString stringWithFormat:@"set%@:forState:",propertyName.mktheme_uppercaseFirstLetterString];
    return NSSelectorFromString(selectorName);
}
@end
